package com.yang.service.Impl;

import com.yang.mapper.UserInfoMapper;
import com.yang.pojo.UserInfo;
import com.yang.responseEntity.Employeeleave;
import com.yang.responseEntity.Interns;
import com.yang.responseEntity.regularEmployee;
import com.yang.service.UserInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service("userInfoService")
public class UserInfoServiceImpl implements UserInfoService {

    @Resource
    UserInfoMapper userInfoMapper;


    @Override
    public UserInfo findByUsername(String username) {
        return userInfoMapper.findByUsername(username);
    }

    @Override
    public UserInfo findById(Integer id) {
        return userInfoMapper.findById(id);
    }

    @Override
    public List<UserInfo> getUserInfoListByPage(String username) {
        return userInfoMapper.getUserInfoListByPage(username);
    }

    @Override
    public int deleteUserInfoById(Integer id) {
        /***
         * 相关系列操作未完成
         */
        return userInfoMapper.deleteUserInfoById(id);
    }

    @Override
    public UserInfo findByPhone(String phone) {
        return userInfoMapper.findByPohne(phone);
    }

    @Override
    public int save(UserInfo userInfo) {
        return userInfoMapper.insert(userInfo);
    }

    @Override
    public int update(UserInfo userInfo) {
        return userInfoMapper.updateByPrimaryKey(userInfo);
    }

    @Override
    public List<regularEmployee> getUserInfoList(String username, Integer workType) {
        return userInfoMapper.getUserInfoList(username,workType);
    }

    @Override
    public List<Interns> getUserInfoListInterns(String username, Integer workType) {
        return userInfoMapper.getUserInfoListInterns(username,workType);
    }

    @Override
    public List<Employeeleave> getUserInfoListLeave(String username) {
        return userInfoMapper.getUserInfoListLeave(username);
    }
}
